package com.gtworldmobile.classes;

import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Point;

import com.google.android.maps.GeoPoint;
import com.google.android.maps.MapView;
import com.google.android.maps.Overlay;

public class MarkerOverlay extends Overlay{
    private GeoPoint p; 
    private Bitmap bmp;
    public MarkerOverlay(GeoPoint p, Bitmap bmp){
        this.p = p;
        this.bmp=bmp;
    }

    @Override
    public boolean draw(Canvas canvas, MapView mapView, 
           boolean shadow, long when){
       super.draw(canvas, mapView, shadow);                   

       //---translate the GeoPoint to screen pixels---
       Point screenPts = new Point();
       mapView.getProjection().toPixels(p, screenPts);

       //---add the marker---
       
                   
       canvas.drawBitmap(bmp, screenPts.x-22, screenPts.y-51, null);        
       return true;
    }
}
